<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/common/tags.jsp"%>
<!DOCTYPE html>
<html>
<head>
    <title>${seo.title}</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="UTF-8">
    <meta name="Keywords" content="${seo.keywords}">
    <meta name="description" content="${seo.description}">
    <%@include file="/common/style.jsp"%>
    <link rel="stylesheet" type="text/css" href="${static_url}/ui/app/assets/css/register.css">

    <%@include file="/common/javascript.jsp"%>
    <%@include file="/common/js/niceValidator.jsp"%>

</head>
<body>
<!-- 头部 -->
<%@include file="/common/myHeader.jsp"%>
<!-- /头部 -->

<!-- 主体 -->
<div class="warp1">
    <div class="user_list pt10 mt50">
        <ul>
            <li class="hover" id="a1" onclick="setTab('a',1,2)">普通用户</li>
            <li id="a2" onclick="setTab('a',2,2)" class="">商家</li>
        </ul>
    </div>
    <div class="login_box">
        <form method="post" action="${ctx}/buyerRegister.htm" name="buyerRegister" id="buyerRegister" data-validator-option="{stopOnError:false, timely:true}">
           <mytag:token/>
            <div id="con_a_1" style="display: block;">
                <div class="item">
                    <span class="float1"><span>*</span>用户名：</span>
                    <div class="item_inp">
                    <input style="width:200px;" class="normal" type="text" name="account" maxlength="40"
                     placeholder="字母、数字和下划线组成"
                               data-rule="required;username;length[4~20];remote[${ctx}/validateAjax.htm?table=t_buyers]"
                               data-msg-required="输入4-20个以字母、数字和下划线组成的用户名"
                               data-ok=""
                               data-target="#uid2_m">   
                    </div>
                    <div class="fl"><span id="uid2_m" class="red12"></span></div>
                </div>
                <div class="item">
                    <span class="float1"><span>*</span>密&nbsp;&nbsp;码：</span>

                    <div class="item_inp"><input style="width:200px;" class="normal" type="password" name="password"  maxlength="40"
                               placeholder="以字母、数字组成"
                               data-rule="required;length[8~40];password;"
                               data-msg-required="输入8-40个以字母、数字组成的密码"
                               data-ok=""
                               data-target="#pwd2_m"
                                >
                    </div>
                    <div class="fl"><span id="pwd2_m" class="red12"></span></div>
                </div>
                <div class="item">
                    <span class="float1"><span>*</span>确认密码：</span>
                    <div class="item_inp"><input style="width:200px;" class="normal" type="password" name="againpassword" maxlength="40"
                               data-rule="required;match(password);"
                               data-msg-required="密码不匹配"
                               data-ok=""
                               data-target="#pwd22_m" >
                    </div>
                    <div class="fl"><span id="pwd22_m" class="red12"></span></div>
                </div>
                <div class="item">
                    <span class="float1"><span>*</span>邮&nbsp;&nbsp;箱：</span>
                    <div class="item_inp"><input style="width:200px;" class="normal" type="text" name="email"   maxlength="50"
                               data-rule="required;email;remote[${ctx}/validateAjax.htm?table=t_buyers]"
                               data-ok=""
                               data-target="#email_m" >
                    </div>
                    <div class="fl"><span id="email_m" class="red12"></span></div>
                </div>
                <!-- <div class="item">
                    <span class="float1"><span>*</span>验证码：</span>
                    <div class="item_inp"><input style="width:100px;" class="normal" type="text" name="yzm" id="yzm" onfocus="chcls(this);" onblur="yzm22();chcls(this);" maxlength="4"></div>
                    <div class="item_r">
                        <label><span class="gray12"><img src="##" align="absmiddle" border="0">&nbsp;&nbsp;<span id="yzm_m" class="red12">请在输入框中键入图片中的数字</span></span>
                        </label>
                    </div>
                </div> -->
                <div class="item">
                    <span class="float1"></span>
                    <div class="item_inp">
                        <input name="tkuan" type="checkbox" class="check" id="tkuan" style="vertical-align:middle;" checked="CHECKED">
                        <span style="vertical-align:middle">我已阅读并同意<a target="_blank" href="##">《易房网注册协议》</a></span></div>
                </div>
                <div class="item">
                    <span class="float1"></span>
                    <div class="item_inp">
                        <input class="button" type="image" src="${static_url}/ui/app/assets/images/login_up.jpg" name="Submit2" >
                    </div>
                </div>
            </div>
        </form>

        <!--商家注册-->
        <div id="con_a_2" style="display: none;">
            <%--
            <div class="login_school">
                 <h2>欢迎注册成为商家用户</h2>
             </div>--%>
            <form method="post" action="${ctx}/sellerRegister.htm" name="sellerRegister" id="sellerRegister" data-validator-option="{stopOnError:false, timely:true}">				
				<input type="hidden" id="form2_token" name="crsf_token" value="" />
                <div class="item">
                    <span class="float1"><span>*</span>用户名：</span>
                    <div class="item_inp">
                        <input style="width:200px;" class="normal" type="text" name="account" maxlength="40"
                               placeholder="字母、数字和下划线组成"
                               data-rule="required;username;length[4~20];remote[${ctx}/validateAjax.htm?table=t_sellers]"
                               data-msg-required="输入4-20个以字母、数字和下划线组成的用户名"
                               data-ok=""
                               data-target="#account_msg1">
                    </div>
                    <div class="fl"><span id="account_msg1" class="red12"></span></div>
                </div>
                <div class="item">
                    <span class="float1"><span>*</span>密&nbsp;&nbsp;码：</span>
                    <div class="item_inp">
                        <input style="width:200px;" class="normal" type="password" name="password"  maxlength="40"
                               placeholder="以字母、数字组成"
                               data-rule="required;length[8~40];password;"
                               data-msg-required="输入8-40个以字母、数字组成的密码"
                               data-ok=""
                               data-target="#password_msg1"
                                >
                    </div>
                    <div class="fl"><span id="password_msg1" class="red12"></span></div>
                </div>
                <div class="item">
                    <span class="float1"><span>*</span>确认密码：</span>
                    <div class="item_inp">
                        <input style="width:200px;" class="normal" type="password" name="againpassword" maxlength="40"
                               data-rule="required;match(password);"
                               data-msg-required="密码不匹配"
                               data-ok=""
                               data-target="#againpassword_msg1" >
                    </div>
                    <div class="fl"><span id="againpassword_msg1" class="red12"></span></div>

                </div>
                <div class="item">
                    <span class="float1"><span>*</span>邮&nbsp;&nbsp;箱：</span>
                    <div class="item_inp">
                        <input style="width:200px;" class="normal" type="text" name="email"   maxlength="50"
                               data-rule="required;email;remote[${ctx}/validateAjax.htm?table=t_sellers]"
                               data-ok=""
                               data-target="#email_msg1" >
                    </div>
                    <div class="fl"><span id="email_msg1" class="red12"></span></div>
                </div>

                <div class="item">
                    <span class="float1"><span>*</span>公司名称：</span>
                    <div class="item_inp">
                        <input style="width:200px;" class="normal"  type="text" name="name" maxlength="50"
                               data-rule="required;length[4~50]"
                               data-ok=""
                               data-target="#name_msg1">
                    </div>
                    <div class="fl"><span id="name_msg1" class="red12"></span></div>
                </div>



                <%--<div class="item">
                    <span class="float1"><span>*</span>验证码：</span>
                    <div class="item_inp">
                        <input style="width:100px;" class="normal" type="text" name="yzm2" id="yzm2" maxlength="4">
                    </div>
                    <div class="item_r">
                        <label>
                            <span class="gray12"><img src="##" align="absmiddle" border="0">&nbsp;&nbsp;<span id="yzm2_m" class="red12"> 请在输入框中键入图片中的数字</span></span>
                        </label>
                    </div>
                </div>--%>
                <div class="item">
                    <span class="float1"></span>
                    <div class="item_inp">
                        <input class="check" type="checkbox" id="tkuan2" name="tkuan2" value="1" checked="CHECKED">
                        <span>我已阅读并同意<a target="_blank" href="##">《易房网注册协议》</a></span></div>
                    <div class="item_t"></div>
                </div>


                <div class="item">
                    <span class="float1"></span>
                    <div class="item_inp">
                        <input class="button" type="image" src="${static_url}/ui/app/assets/images/login_up.jpg" name="Submit2">
                    </div>
                </div>

            </form>
        </div>
    </div>
</div>
<script>
$(function(){
	$("#form2_token").val($("#buyerRegister").find("input[name='crsf_token']").val());
});
    function setTab(name,cursel,n){
        for(i=1;i<=n;i++){
            var menu=document.getElementById(name+i);
            var con=document.getElementById("con_"+name+"_"+i);
            menu.className=i==cursel?"hover":"";
            con.style.display=i==cursel?"block":"none";
        }
    }

    <c:if test="${tab==2}">
    setTab('a',2,2);
    </c:if>
</script>
<!-- /主体 -->

<!-- 底部 -->
<%@include file="/common/footer.jsp"%>
<!-- /底部 -->

</body>
</html>
